package com.humanresource.action.clerkrecord;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.humanresource.domain.Result;
import com.humanresource.domain.po.clerksalary.Salarystandard;
import com.humanresource.service.clerkrecord.PosService;
import com.humanresource.utils.ResultUtil;

@Controller
@RequestMapping("/pos")
public class PosController {
	@Autowired
	private PosService posService;

	@RequestMapping(value = "/all", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
	@ResponseBody
	public Result posResult() {
		return ResultUtil.success(posService.posList());
	}

	@RequestMapping(value = "/query/salarystandard/{posname}", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
	@ResponseBody
	public Result postoquerysalarystandard(
			@PathVariable(value = "posname") String posname) {
		Salarystandard salarystandard = this.posService
				.findSalarystandardByPosname(posname);
		return ResultUtil.success(salarystandard);
	}
}
